package org.googlecode.viewt.core.tools.contants;


public class DataConfigGenerator extends BaseConstantGenerator
{
  public static final String CONTEXT_PROP_CONSTANTSDEF = "CONSTANTSDEF";
  private boolean generated = false;

  public String getLoggerCategory()
  {
    return "DataConfigGenerator";
  }

  public String getTemplate(String className)
    throws Exception
  {
    return "xml_DATACONFIG.vm";
  }

  public String getOutputFile(String className)
    throws Exception
  {
    if (!(this.generated)) {
      this.generated = true;
    }
    return ConstantUtil.dataConfigFile(getDestPath(), getConstantsDef().getModuleName());
  }

  public boolean needGenerate(String className)
    throws Exception
  {
    return (!(this.generated));
  }

  public void setupContext()
    throws Exception
  {
  }

  public void setupContext(String className)
    throws Exception
  {
    getContext().put("CONSTANTSDEF", getConstantsDef());
  }

  public void cleanContext(String className)
    throws Exception
  {
    getContext().remove("CONSTANTSDEF");
  }

  public void cleanContext()
    throws Exception
  {
  }
}